package org.huntaway.kindergarten.po.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the personinfo table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="personinfo"
 */

public abstract class BasePersoninfo extends BasePo implements Serializable {

	public static String REF = "Personinfo";
	public static String PROP_PHONE = "Phone";
	public static String PROP_T_NAME = "TName";
	public static String PROP_ISUSE = "Isuse";
	public static String PROP_INDATE = "Indate";
	public static String PROP_T_STATE = "TState";
	public static String PROP_BIRTHDAY = "Birthday";
	public static String PROP_INTRODUCTION = "Introduction";
	public static String PROP_ADDRESS = "Address";
	public static String PROP_ID = "Id";
	public static String PROP_REMARK = "Remark";
	public static String PROP_SEX = "sex";


	// constructors
	public BasePersoninfo () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BasePersoninfo (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public BasePersoninfo (
		java.lang.Integer id,
		java.lang.Integer isuse) {

		this.setId(id);
		this.setIsuse(isuse);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.String tName;
	private java.lang.String sex;
	private java.util.Date birthday;
	private java.util.Date indate;
	private java.lang.String remark;
	private java.lang.String introduction;
	private java.lang.Integer tState;
	private java.lang.String phone;
	private java.lang.String address;
	private java.lang.Integer isuse;

	// collections
	private java.util.Set<org.huntaway.kindergarten.po.Ttg> ttgs;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="native"
     *  column="person_id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: t_name
	 */
	public java.lang.String getTName () {
		return tName;
	}

	/**
	 * Set the value related to the column: t_name
	 * @param tName the t_name value
	 */
	public void setTName (java.lang.String tName) {
		this.tName = tName;
	}



	/**
	 * Return the value associated with the column: sex
	 */
	public java.lang.String getSex () {
		return sex;
	}

	/**
	 * Set the value related to the column: sex
	 * @param sex the sex value
	 */
	public void setSex (java.lang.String sex) {
		this.sex = sex;
	}



	/**
	 * Return the value associated with the column: birthday
	 */
	public java.util.Date getBirthday () {
		return birthday;
	}

	/**
	 * Set the value related to the column: birthday
	 * @param birthday the birthday value
	 */
	public void setBirthday (java.util.Date birthday) {
		this.birthday = birthday;
	}



	/**
	 * Return the value associated with the column: indate
	 */
	public java.util.Date getIndate () {
		return indate;
	}

	/**
	 * Set the value related to the column: indate
	 * @param indate the indate value
	 */
	public void setIndate (java.util.Date indate) {
		this.indate = indate;
	}



	/**
	 * Return the value associated with the column: remark
	 */
	public java.lang.String getRemark () {
		return remark;
	}

	/**
	 * Set the value related to the column: remark
	 * @param remark the remark value
	 */
	public void setRemark (java.lang.String remark) {
		this.remark = remark;
	}



	/**
	 * Return the value associated with the column: introduction
	 */
	public java.lang.String getIntroduction () {
		return introduction;
	}

	/**
	 * Set the value related to the column: introduction
	 * @param introduction the introduction value
	 */
	public void setIntroduction (java.lang.String introduction) {
		this.introduction = introduction;
	}



	/**
	 * Return the value associated with the column: t_state
	 */
	public java.lang.Integer getTState () {
		return tState;
	}

	/**
	 * Set the value related to the column: t_state
	 * @param tState the t_state value
	 */
	public void setTState (java.lang.Integer tState) {
		this.tState = tState;
	}



	/**
	 * Return the value associated with the column: phone
	 */
	public java.lang.String getPhone () {
		return phone;
	}

	/**
	 * Set the value related to the column: phone
	 * @param phone the phone value
	 */
	public void setPhone (java.lang.String phone) {
		this.phone = phone;
	}



	/**
	 * Return the value associated with the column: address
	 */
	public java.lang.String getAddress () {
		return address;
	}

	/**
	 * Set the value related to the column: address
	 * @param address the address value
	 */
	public void setAddress (java.lang.String address) {
		this.address = address;
	}

	/**
	 * Return the value associated with the column: isuse
	 */
	public java.lang.Integer getIsuse () {
		return isuse;
	}

	/**
	 * Set the value related to the column: isuse
	 * @param isuse the isuse value
	 */
	public void setIsuse (java.lang.Integer isuse) {
		this.isuse = isuse;
	}



	/**
	 * Return the value associated with the column: Ttgs
	 */
	public java.util.Set<org.huntaway.kindergarten.po.Ttg> getTtgs () {
		return ttgs;
	}

	/**
	 * Set the value related to the column: Ttgs
	 * @param ttgs the Ttgs value
	 */
	public void setTtgs (java.util.Set<org.huntaway.kindergarten.po.Ttg> ttgs) {
		this.ttgs = ttgs;
	}

	public void addToTtgs (org.huntaway.kindergarten.po.Ttg ttg) {
		if (null == getTtgs()) setTtgs(new java.util.TreeSet<org.huntaway.kindergarten.po.Ttg>());
		getTtgs().add(ttg);
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof org.huntaway.kindergarten.po.Personinfo)) return false;
		else {
			org.huntaway.kindergarten.po.Personinfo personinfo = (org.huntaway.kindergarten.po.Personinfo) obj;
			if (null == this.getId() || null == personinfo.getId()) return false;
			else return (this.getId().equals(personinfo.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}